package com.eqxiu.ieditor.weixin;

import java.util.concurrent.CountDownLatch;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@MapperScan(value = "com.eqxiu.ieditor.weixin.dao")
//@ComponentScan("com.eqxiu.weixin")
//@EnableConfigurationProperties(value = WxProperties.class)
//@PropertySources({ @PropertySource(value = "classpath:weixin.properties", ignoreResourceNotFound = false) })
public class WeiXinApplication {

	private static final Logger LOGGER = LoggerFactory.getLogger(WeiXinApplication.class);

	@Bean
	public CountDownLatch closeLatch() {
		return new CountDownLatch(1);
	}

	public static void main(String[] args) throws InterruptedException {
		ApplicationContext ctx = new SpringApplicationBuilder().sources(WeiXinApplication.class).run(args);
		LOGGER.info("WeiXinApplication service started!");
		CountDownLatch closeLatch = ctx.getBean(CountDownLatch.class);
		closeLatch.await();
	}

}
